<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" http-equiv="Content-Type" content="text/html">
    <title th:text="${section}"></title>

    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css"
          integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <link rel="stylesheet" href="/css/community.css">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"
            integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
            crossorigin="anonymous"></script>
</head>

<body>
<div th:insert="~{navigation :: nav}"></div>
<div class="container-fluid main profile">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
            <h2><span class="glyphicon glyphicon-list-alt" aria-hidden="true" th:text="${sectionName}"></span></h2>
            <hr>
            <div class="media" th:each="question: ${questions.items}">
                <div class="media-left">
                    <a href="#">
                        <!-- http://b-ssl.duitang.com/uploads/item/201704/10/20170410095843_SEvMy.thumb.700_0.jpeg -->
                        <img class="media-object img-circle" th:src="${question.user.avatarUrl}">
                    </a>
                </div>
                <div class="media-body">
                    <h4 class="media-heading"><span th:text="${question.title}"></span></h4>
                    点击xxx<br>
                    <span class="text-desc"><span th:text="${question.commentCount}">评论</span>, <span
                            th:text="${question.viewCount}"></span> 浏览,
                            <span th:text="${#dates.format(question.gmtCreate,'yyyy-MM-dd HH:mm')}"></span>发布的</span>
                </div>
            </div>
            <!--                <span th:text="${questions}"></span>-->
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li th:if="${questions?.showFirstPage}">
                        <a th:href="@{'/profile/'+${section}(page=1,search=${search})}" aria-label="Previous">
                            <span aria-hidden="true">&lt;&lt;</span>
                        </a>
                    </li>
                    <li th:if="${questions?.showPrevious}">
                        <a th:href="@{'/profile/'+${section}(page=${questions.current-1})}" aria-label="Previous">
                            <span aria-hidden="true">&lt;</span>
                        </a>
                    </li>


                    <li th:each="page : ${questions?.pages}" th:class="${questions.current == page} ? 'active' : ''">
                        <a th:href="@{'/profile/'+${section}(page=${page})}" th:text="${page}"></a>
                    </li>


                    <li th:if="${questions?.showNext}">
                        <a th:href="@{'/profile/'+${section}(page=${questions.current+1})}" aria-label="Next">
                            <span aria-hidden="true">&gt;</span>
                        </a>
                    </li>
                    <li th:if="${questions?.showEndPage}">
                        <a th:href="@{'/profile/'+${section}(page=${questions.total})}" aria-label="Next">
                            <span aria-hidden="true">&gt;&gt;</span>
                        </a>
                    </li>
                </ul>
            </nav>

        </div>
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
            <div class="list-group section">
                <a href="/profile/questions"
                   th:class="${section == 'questions'? 'list-group-item active' : 'list-group-item'}">我的问题</a>
                <a href="/profile/replies"
                   th:class="${section == 'replies'? 'list-group-item active' : 'list-group-item'}">
                    <span class="badge">14</span>
                    最新回复</a>
                <!--                <a href="#" class="list-group-item">Morbi leo risus</a>-->
                <!--                <a href="#" class="list-group-item">Porta ac consectetur ac</a>-->
                <!--                <a href="#" class="list-group-item">Vestibulum at eros</a>-->
            </div>
        </div>
    </div>
</div>
</body>
</html>